<template>
  <view :style="themeColor">
    <view class="page">
      <fu-custom bgColor="bg-white" :isBack="true" :isBottom="true">
        <block slot="content">自由贸易区</block>
      </fu-custom>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-wrap align-center justify-between ziyoumaoyiqufabu_fd1_0' @tap.stop="handleJumpDiy"
          data-type="navigateTo" :data-url="`/pages/sy/fabuxuzhi/fabuxuzhi?id=20`">
          <view class='flex flex-wrap align-center'>
            <text class='ziyoumaoyiqufabu_fd1_0_c0_c0'>自由贸易区说明</text>
            <text class='fu-iconfont2  ziyoumaoyiqufabu_fd1_0_c0_c1'>&#xe735;</text>
          </view>
          <text class='fu-iconfont2  ziyoumaoyiqufabu_fd1_0_c1'>&#xe7f2;</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1699684609220" :mask="true" :mask-close-able="false" mode='center'>
        <!---钱包说明flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center benben-flex-layout">
          <view class='flex flex-direction flex-wrap align-center ziyoumaoyiqufabu_fd2_0'>
            <text class='ziyoumaoyiqufabu_fd2_0_c0'>展示位置说明</text>

            <scroll-view class='ziyoumaoyiqufabu_fd2_0_c1' :scroll-y='true'>
              <view class='flex benben-scroll flex align-center'>
                <jyf-parser class='ziyoumaoyiqufabu_fd2_0_c1_c0'>
                </jyf-parser>
              </view>
            </scroll-view>

          </view>
          <image class='ziyoumaoyiqufabu_fd2_1' mode="aspectFit" :src='STATIC_URL+"613.png"'></image>
        </view>

        <!---钱包说明flex布局结束-->

      </benben-popup>
      <!---发布出租信息flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout ziyoumaoyiqufabu_flex_3">
        <view class='flex flex-direction flex-wrap align-stretch'>
          <text class='ziyoumaoyiqufabu_fd3_0_c0'>*此处为生活服务类发布，其他信息请去“自由贸易区”进行发布</text>
          <view class='flex flex-wrap align-center justify-between ziyoumaoyiqufabu_fd3_0_c1'>
            <input class='ziyoumaoyiqufabu_fd3_0_c1_c0' type="text" :placeholder="`请输入标题`" confirm-type="done"
              :maxlength="50" placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="title" />
            <text class='ziyoumaoyiqufabu_fd3_0_c1_c1'>50字以内</text>
          </view>
          <view class='flex-wrap flex ziyoumaoyiqufabu_fd3_0_c2'>
            <textarea class='flex ziyoumaoyiqufabu_input_fd3_0_c2' :placeholder="'描写一下详情信息吧…'" :maxlength="300"
              :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="describe" />
            <template>
              <view class='flex flex justify-end ziyoumaoyiqufabu_numberfd3_0_c2_c0'>
                <text>{{describe.length}}</text>
                <text>/</text>
                <text>300</text>
              </view>
            </template>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='ziyoumaoyiqufabu_fd3_0_c3_c0'>上传图片/视频</text>
            <benben-images-upload ref="benbenImagesUploadfd3_0_c3_c1" :img-list.sync="imgurl" :img-ids.sync="files"
              :maxlength="9">
              <template #content="{ num, maxlength, isShow, imgList }">
                <view class="flex flex-wrap align-start flex ziyoumaoyiqufabu_fd3_0_c3_c1">

                  <view v-for="(image, index) in imgList" :key="index"
                    class='flex position-relative ziyoumaoyiqufabu_fd3_0_c3_c10'>
                    <text class='fu-iconfont2 position-absolute ziyoumaoyiqufabu_fd3_0_c3_c100'
                      @tap.stop="$refs.benbenImagesUploadfd3_0_c3_c1.delImage(index)">&#xE8E7;</text>
                    <image class='ziyoumaoyiqufabu_fd3_0_c3_c101'
                      @tap.stop="$refs.benbenImagesUploadfd3_0_c3_c1.previewImage(index)" mode="aspectFit" :src='image'>
                    </image>
                  </view>

                  <image class='ziyoumaoyiqufabu_fd3_0_c3_c11'
                    @tap.stop="$refs.benbenImagesUploadfd3_0_c3_c1.manyChooseImage()" v-if="isShow" mode="aspectFit"
                    :src='STATIC_URL+"297.jpg"'></image>

                </view>
              </template>
            </benben-images-upload>
          </view>
        </view>
        <view class='flex flex-wrap align-center ziyoumaoyiqufabu_fd3_1'>
          <view class='flex flex-wrap align-center self-center' @tap.stop="popupShow1699684609220=false">
            <image class='ziyoumaoyiqufabu_fd3_1_c0_c0' mode="aspectFit" :src='STATIC_URL+"531.png"'></image>
            <text class='ziyoumaoyiqufabu_fd3_1_c0_c1'>位置</text>
          </view>
          <view class='flex flex-wrap align-center justify-end flex-sub' @tap.stop="pickerDiy1702368958676=true">
            <text class='ziyoumaoyiqufabu_fd3_1_c1_c0'>{{address}}</text>
            <text class='fu-iconfont2  ziyoumaoyiqufabu_fd3_1_c1_c1'>&#xE7F2;</text>
          </view>
        </view>
        <view class='flex flex-direction align-stretch'>
          <view class='flex flex-wrap align-center ziyoumaoyiqufabu_fd3_2_c0'>
            <view class='flex flex-wrap align-center self-center' @tap.stop="popupShow1699684609220=false">
              <image class='ziyoumaoyiqufabu_fd3_1_c0_c0' mode="aspectFit" :src='STATIC_URL+"544.png"'></image>
              <text class='ziyoumaoyiqufabu_fd3_1_c0_c1'>价格(￥)</text>
            </view>
            <input class='flex-sub ziyoumaoyiqufabu_fd3_2_c0_c1' type="number" :placeholder="`请输入`" confirm-type="done"
              :maxlength="20" placeholder-style="color:#999;font-size:32rpx" v-model="shop_price" />
          </view>
        </view>
      </view>

      <!---发布出租信息flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout ziyoumaoyiqufabu_flex_4">
        <text class='ziyoumaoyiqufabu_fd4_0'>联系信息</text>
        <view class='flex flex-wrap align-center ziyoumaoyiqufabu_fd4_1'>
          <text class='ziyoumaoyiqufabu_fd4_1_c0'>姓名</text>
          <input class='flex-sub ziyoumaoyiqufabu_fd4_1_c1' type="text" :placeholder="`请输入联系人姓名或公司名称`"
            confirm-type="done" :maxlength="-1" placeholder-style="color:#999;font-size:32rpx" v-model="username" />
        </view>
        <view class='flex flex-wrap align-center ziyoumaoyiqufabu_fd4_2'>
          <text class='ziyoumaoyiqufabu_fd4_1_c0'>电话</text>
          <input class='flex-sub ziyoumaoyiqufabu_fd4_1_c1' type="number" :placeholder="`请输入手机号`" confirm-type="done"
            :maxlength="11" placeholder-style="color:#999;font-size:32rpx" v-model="mobile" />
        </view>

        <view class='flex flex-wrap align-center'>
          <button class='ziyoumaoyiqufabu_fd4_4_c0' @tap.stop="submitFunc()">确认发布</button>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!--选择器开始 -->
      <benben-picker ref="benbenWritePickerCodepicker5" :visible.sync="pickerDiy1702368958676" mode='region'
        :mask-show='true' :picker-height='88' :hide-area='false'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between ziyoumaoyiqufabu_picker5_0'>
            <text @tap="$refs.benbenWritePickerCodepicker5.cancel()">取消</text>
            <text>标题</text>
            <text class='ziyoumaoyiqufabu_picker5_0_c2'
              @tap="$refs.benbenWritePickerCodepicker5.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
      <!--选择器结束 -->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "pickerDiy1702368958676": false,
        "popupShow1699684609220": false,
        "types": [],
        "title": "",
        "describe": "",
        "files": "",
        "shop_price": "",
        "address": "",
        "username": "",
        "mobile": "",
        "imgurl": []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //提交
      async submitFunc() {
        if (!validate(this.title, 'require')) {
          this.$message.info('请输入标题');
          return false;
        }
        if (!validate(this.describe, 'require')) {
          this.$message.info('请输入描述');
          return false;
        }
        if (!validate(this.files, 'require')) {
          this.$message.info('请上传图片');
          return false;
        }
        if (!validate(this.address, 'require')) {
          this.$message.info('请选择地址');
          return false;
        }
        if (!validate(this.shop_price, 'require')) {
          this.$message.info('请输入价格');
          return false;
        }
        if (!validate(this.username, 'require')) {
          this.$message.info('请输入姓名');
          return false;
        }
        if (!validate(this.mobile, 'require')) {
          this.$message.info('请输入联系方式');
          return false;
        }
        if (!validate(this.mobile, 'phone')) {
          this.$message.info('请输入正确的联系方式');
          return false;
        }
        //请求方法
        //数据验证

        let data65715f0f3cc47 = await this.$api.post(global.apiUrls.post65715f0f3cc47, {
          title: this.title,
          describe: this.describe,
          files: this.files,
          shop_price: this.shop_price,
          address: this.address,
          username: this.username,
          mobile: this.mobile
        });

        if (data65715f0f3cc47.data.code != 1) {
          this.$message.info(data65715f0f3cc47.data.msg);
          return
        }



        this.$urouter.navigateBack(1);
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .ziyoumaoyiqufabu_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .ziyoumaoyiqufabu_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333333;
    line-height: 88rpx;
  }

  .ziyoumaoyiqufabu_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .ziyoumaoyiqufabu_fd0_0_c0 {
    width: 120rpx;
  }

  .ziyoumaoyiqufabu_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .ziyoumaoyiqufabu_fd1_0_c1 {
    color: var(--benbenFontColor2);
    font-size: 24rpx;
  }

  .ziyoumaoyiqufabu_fd1_0_c0_c1 {
    font-size: 28rpx;
  }

  .ziyoumaoyiqufabu_fd1_0_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd1_0 {
    background: rgba(253, 171, 87, 0.08);
    padding: 0rpx 32rpx 0rpx 32rpx;
    width: 750rpx;
    height: 84rpx;
  }

  .ziyoumaoyiqufabu_fd2_1 {
    width: 56rpx;
    height: 56rpx;
    margin: 48rpx 0rpx 0rpx 0rpx;
  }

  ::v-deep .ziyoumaoyiqufabu_fd2_0_c1_c0 {
    width: 100%;
  }

  .ziyoumaoyiqufabu_fd2_0_c1 {
    touch-action: none;
    width: 482rpx;
    height: 458rpx;
  }

  .ziyoumaoyiqufabu_fd2_0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    margin: 40rpx 0rpx 30rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd2_0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 540rpx;
    padding: 0rpx 0rpx 40rpx 0rpx;
  }

  .ziyoumaoyiqufabu_flex_3 {
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .ziyoumaoyiqufabu_fd3_2_c0_c1 {
    text-align: right;
    font-size: 32rpx;
    font-weight: 400;
    color: #333;
  }

  .ziyoumaoyiqufabu_fd3_2_c0 {
    border-bottom: 1px solid #eee;
    height: 109rpx;
  }

  .ziyoumaoyiqufabu_fd3_1_c1_c1 {
    margin: 0rpx 0rpx 0rpx 15rpx;
    font-size: 24rpx;
  }

  .ziyoumaoyiqufabu_fd3_1_c1_c0 {
    font-size: 32rpx;
    font-weight: 400;
    color: #9C9C9C;
  }

  .ziyoumaoyiqufabu_fd3_1_c0_c1 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    margin: 0rpx 12rpx 0rpx 12rpx;
  }

  .ziyoumaoyiqufabu_fd3_1_c0_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd3_1 {
    border-bottom: 1px solid #EEEEEE;
    height: 109rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c11 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c101 {
    width: 160rpx;
    height: 160rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c100 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c10 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c1 {
    width: 686rpx;
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c3_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 48rpx;
  }

  .ziyoumaoyiqufabu_numberfd3_0_c2_c0 {
    width: 100%;
    font-size: 24rpx;
    color: var(--benbenFontColor1);
    line-height: 46rpx;
    font-weight: 400;
  }

  .ziyoumaoyiqufabu_input_fd3_0_c2 {
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .ziyoumaoyiqufabu_fd3_0_c2 {
    background: #F6F7F9;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 10rpx 10rpx 0rpx 16rpx;
    width: 100%;
    margin: 32rpx 0rpx 32rpx 0rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c1_c1 {
    color: #999999;
    font-size: 22rpx;
    font-weight: 400;
  }

  .ziyoumaoyiqufabu_fd3_0_c1_c0 {
    width: 500rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c1 {
    border-bottom: 1px solid #eee;
    line-height: 88rpx;
    height: 88rpx;
  }

  .ziyoumaoyiqufabu_fd3_0_c0 {
    font-size: 24rpx;
    font-weight: 400;
    color: #CC0000;
    line-height: 60rpx;
  }

  .ziyoumaoyiqufabu_flex_4 {
    border-top: 10px solid rgba(246, 247, 249, 1);
    background: var(--benbenbgColor4);
    padding: 0rpx 32rpx 100rpx 32rpx;
    background-size: 100% auto;
  }

  .ziyoumaoyiqufabu_fd4_4_c0 {
    background: #FF8533;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
    width: 686rpx;
  }

  .ziyoumaoyiqufabu_fd4_2 {
    border-bottom: 1px solid #DDDDDD;
    height: 109rpx;
  }

  .ziyoumaoyiqufabu_fd4_1_c1 {
    text-align: right;
    font-size: 32rpx;
    font-weight: 400;
    color: #333;
  }

  .ziyoumaoyiqufabu_fd4_1_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
  }

  .ziyoumaoyiqufabu_fd4_1 {
    border-bottom: 1px solid #eee;
    height: 109rpx;
  }

  .ziyoumaoyiqufabu_fd4_0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    padding: 24rpx 0rpx 0rpx 0rpx;
  }

  .ziyoumaoyiqufabu_picker5_0_c2 {
    color: #4781f5;
  }

  .ziyoumaoyiqufabu_picker5_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }
</style>